<template>
  <headPage></headPage>
  <div class="main_box">
    <div class="navigate_view">
      <span class="navigate_text" @click="goHome">首页</span>
      <span class="navigate_line">/</span>
      <span class="navigate_last_text">帮助中心</span>
    </div>
    <div class="content" v-loading="loading">
      <titleText title="帮助中心"></titleText>
      <div class="list">
        <div
          class="item"
          v-for="(item, index) in helpCenterList"
          :key="index"
          @click="goDetails(item.aid)"
        >
          <div class="item_le">
            <div class="item_le_1"></div>
            <div class="item_le_2">{{ item.wenzhangbiaoti }}</div>
          </div>
          <div class="item_ri">{{ item.create_time }}</div>
        </div>
      </div>
      <div class="no_data" v-if="helpCenterList.length == 0 && !loading">
        <img class="no_img" src="../../../assets/default/12.png" alt="">
      </div>
      
    </div>
    <div class="margin_top">
        <paging :total="total" :pageSize="pageSize" @pageChange="pageChange"></paging>
      </div>
  </div>
  <footerPage></footerPage>
</template>

<script name="helpCenter" setup>
import { post65eaeeb0db3ac } from "@/utils/api.js";
import headPage from "@/components/headPage.vue";
import footerPage from "@/components/footerPage.vue";
import titleText from "../titleBack.vue";
import paging from "@/components/paging.vue";
import { useRouter } from "vue-router";
import { ref, reactive, onMounted } from "vue";
const router = useRouter();

onMounted(() => {
  getList();
})
// 平台公告列表
let helpCenterList = reactive([]);
let total = ref(0);
let loading = ref(true);
let pageNum = ref(1);
let pageSize = ref(10);
function getList() {
  post65eaeeb0db3ac({
    page: pageNum.value,
    list_rows: pageSize.value,
  }).then((res) => {
    // console.log(res);
    loading.value = false;
    if (res.code == 1) {
      total.value = res.data.total;
      helpCenterList = res.data.data;
    }
  });
}
function goDetails(aid) {
  router.push({
    path: "/setUp/helpDetails",
    query: {
      aid: aid,
    }
  });
}
function goHome() {
  router.push({
    path: "/",
  });
}
// 分页
function pageChange(page) {
  pageNum.value = page;
  loading.value = true;
  getList();
}
</script>

<style lang="scss" scoped>
.navigate_view {
  margin-top: 97px;
  display: flex;
  align-items: center;
  padding: 13.5px 0 12px 0;
  .navigate_text {
    font-size: 9px;
    color: #666;
    cursor: pointer;
  }
  .navigate_line {
    font-size: 9px;
    color: #bfbfbf;
    margin: 0 5px;
  }
  .navigate_last_text {
    font-size: 9px;
    color: #1f52ae;
    cursor: pointer;
  }
}
.content {
  background: #fff;
  padding: 12px 14px 0;
  margin-bottom: 20px;
  min-height: 337px;
}
.list {
  padding: 13px 0 1px;
  .item {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    .item_le {
      display: flex;
      align-items: center;
      .item_le_1 {
        width: 4px;
        height: 4px;
        background: #1f52ae;
        border-radius: 50%;
        margin-right: 7px;
      }
      .item_le_2 {
        font-size: 9px;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        -webkit-line-clamp: 1;
      }
    }
    .item_ri {
      font-size: 9px;
      color: #999;
    }
  }
}
.margin_top {
  margin-bottom: 24px;
}
</style>
